<!DOCTYPE html>
<html>
<head>
    <title>LUI组件库</title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0">
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <meta name="format-detection" content="telephone=no" />
    <meta http-equiv="Cache-Control" CONTENT="no-cache">
    <meta http-equiv="Pragma" CONTENT="no-cache">
    <meta name="keywords" content=""/>
    <meta name="description" content="" />
    <link rel="icon" href="images/icon/lui.png">
    <link rel="stylesheet" type="text/css" href="css/lui.css" />
    <link href="//netdna.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
</head>
<body>
    <div class="ui_page_wrap">
        <header class="ui_page_hd">LUI</header>
        <div class="ui_page_bd">
            <script id="tpl" type="text/html">
                <section>
                    <fieldset class="ui_legend">
                        <legend>css组件</legend>
                    </fieldset>
                    <ul class="ui_list_padded ui_list_arrow">
                        {{# for(var i = 0,len = d.cssComponent.length;i< len;i++ ){ }}
                            <li><a href="{{d.cssComponent[i].href}}"><i class="{{d.cssComponent[i].icon}}"></i>{{d.cssComponent[i].text}}</a></li>
                        {{# } }}
                    </ul>
                </section>
                <section>
                    <fieldset class="ui_legend">
                        <legend>js组件</legend>
                    </fieldset>
                    <ul class="ui_list_padded ui_list_arrow">
                        {{# for(var i = 0,len = d.jsComponent.length;i< len;i++ ){ }}
                            <li><a href="{{d.jsComponent[i].href}}"><i class="{{d.jsComponent[i].icon}}"></i>{{d.jsComponent[i].text}}</a></li>
                        {{# } }}
                    </ul>     
                </section>   
                <section>
                    <fieldset class="ui_legend">
                        <legend>其他</legend>
                    </fieldset>
                    <ul class="ui_list_padded ui_list_arrow">
                        {{# for(var i = 0,len = d.list.length;i< len;i++ ){ }}
                            <li><a href="{{d.list[i].href}}"><i class="{{d.list[i].icon}}"></i>{{d.list[i].text}}</a></li>
                        {{# } }}
                    </ul>     
                </section>         
            </script>

            <div id="tpl_view"></div>
        </div>
    </div>
</body> 
    <!--https://www.cnblogs.com/JsonShare/p/6018497.html-->
    <script type="text/javascript" src="js/3rd-plugins/laytpl.js"></script>  
    <script type="text/javascript" src="js/lui.js"></script>
    <script type="text/javascript">
         lui.request({
            type:'GET',
            url:'js/data/lui.json',
            success:function(res){
                var gettpl = document.getElementById('tpl').innerHTML;
                laytpl(gettpl).render(res, function(html){
                  document.getElementById('tpl_view').innerHTML = html;
                });
            }
        })
    </script>
</body>
</html>